package LawsonTransformJava.pgm;
import java.io.*;
import java.sql.SQLException;


public class PR560Control implements Runnable {

	private File output = null;
	private File errOutput = null;
	private File errReport = null;
	private String whereClause = null;
	private boolean allowBlanks = false;
	private int payrollYear = 0;

	public PR560Control(File output, File errOutput, File errReport, int payrollYear, boolean allowBlanks) {
		this.output = output;
		this.errOutput = errOutput;
		this.errReport = errReport;
		this.allowBlanks = allowBlanks;
		this.payrollYear = payrollYear;
	}
	
	public void run() {
		try {
			PR560RecType1 pr560Rec1 = new PR560RecType1(output, errOutput, errReport, payrollYear, allowBlanks);
			if (whereClause!=null) {
				pr560Rec1.setWhereClause(whereClause);
			}
			pr560Rec1.run();
		} catch (SQLException e) {
			// Could not connect to the database
			System.out.println("SQLException: " + e);
			System.exit(1);
		}
	}
	
	public void setWhereClause(String where) {
		this.whereClause = where;
	}
}
